﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpModelInterface.h"
#include "IObject.h"

namespace gcmp
{
    class UniIdentity;

    /// \brief 元素所属的类别
    class GCMP_MODEL_INTERFACE_EXPORT ICategory : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::ICategory, gcmp::IObject);

    public:
        //测试覆盖
        /// \brief 创建类别
        ///
        /// \param categoryUid 类别Uid
        /// \param categoryName 类别名称
        /// \param categoryDescription 类别描述
        /// \return 类别
        static OwnerPtr<ICategory> Create(const UniIdentity& categoryUid, const std::wstring& categoryName, const std::wstring& categoryDescription);

        /// \brief 创建类别
        ///
        /// \param categoryUid 类别Uid
        /// \param parentCategoryUid 父类别Uid
        /// \param categoryName 类别名称
        /// \param categoryDescription 类别描述
        /// \return 类别
        static OwnerPtr<ICategory> Create(const UniIdentity& categoryUid, const UniIdentity& parentCategoryUid, const std::wstring& categoryName, const std::wstring& categoryDescription);

        /// \brief 克隆类别
        /// \return 类别
        virtual OwnerPtr<ICategory> Clone() const = 0;

        /// \brief 获得类别名称
        /// \return 类别名称
        virtual const std::wstring& GetName() const = 0;

        /// \brief 获得类别Uid
        /// \return 类别Uid
        virtual const UniIdentity& GetUniIdentity() const = 0;

        /// \brief 获得父类别Uid
        /// \return 父类别Uid
        virtual const UniIdentity& GetParentUniIdentity() const = 0;

        /// \brief 判断是否为子类别
        /// \return 返回true表示是子类别，返回false表示不是子类别。
        virtual bool IsSubCategory() const = 0;

        /// \brief 返回类别是否允许设置材质
        /// \return 返回true表示是允许，返回false表示不允许。
        virtual bool CanHaveGraphicsMaterial() const = 0;
    };
}

